package com.kl.oss.tencent;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Value("${tencent.cloud.oss.secretId}")
    private String secretId;

    @Value("${tencent.cloud.oss.secretKey}")
    private String secretKey;

    @Value("${tencent.cloud.oss.region}")
    private String region;

    /**
     * 指定初始化方法
     */
    @Bean(initMethod = "init")
    public TencentCosManager tencentCosManager() {
        return TencentCosManager.newTencentCosManager(secretId, secretKey, region);
    }
}
